﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace xycn.framework.Common
{
    /// <summary>
    /// Api说明文档视图
    /// </summary>
    public class ApiHelpView
    {
        /// <summary>
        /// Api名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// Api跳转Hash
        /// </summary>
        public string TitleHrefId { get; set; }

        /// <summary>
        /// Api详情信息
        /// </summary>
        public ApiHelpDetail ApiDetil { get; set; }

        /// <summary>
        /// 子节点Api信息
        /// </summary>
        public List<ApiHelpView> SubApiList { get; set; }
    }

    /// <summary>
    /// Api详情说明
    /// </summary>
    public class ApiHelpDetail
    {
        /// <summary>
        /// Api名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// Api跳转Hash
        /// </summary>
        public string TitleHrefId { get; set; }

        /// <summary>
        /// Api请求路径Path
        /// </summary>
        public string ApiPath { get; set; }

        /// <summary>
        /// Api请求方式 GET POST DELETE PUT 等
        /// </summary>
        public string ApiMethod { get; set; }

        /// <summary>
        /// 请求参数明细
        /// </summary>
        public List<ApiParamsDetail> ReqParams { get; set; }

        /// <summary>
        /// 回应参数明细
        /// </summary>
        public List<ApiParamsDetail> ResParams { get; set; }
    }

    /// <summary>
    /// Api参数明细
    /// </summary>
    public class ApiParamsDetail
    {
        /// <summary>
        /// 参数名
        /// </summary>
        public string PName { get; set; }

        /// <summary>
        /// 参数层级 默认 0 为第一层
        /// </summary>
        public int ParamLevel { get; set; }

        /// <summary>
        /// 上级参数名称
        /// </summary>
        public string FatherPName { get; set; }

        /// <summary>
        /// 是否必须
        /// </summary>
        public string IsMust { get; set; }

        /// <summary>
        /// 示例值
        /// </summary>
        public string DemoValue { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }
}
